package cn.itcast.crm.service.base;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface ICustomerService {
	
	//查询已关联到定区的客户列表
	@Path("/has/{fixedareaid}")
	@GET
	@Produces({"application/xml","application/json"})
	@Consumes({"application/xml","application/json"})
	public List<Customer> findHasAssociationCustomer(@PathParam("fixedareaid") String fixedAreaId);
	//查询未关联的客户
	@Path("/no")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findNoAssociationCustomer();
	//将客户关联到定区上，将所有客户id，拼成字符串
	@Path("/to")
	@PUT

	public void ssociationCustomersToFixedArea(
			@QueryParam("customerIdStr") String customerIdStr, //客户id
			@QueryParam("fixedAreaId") String fixedAreaId   //定区id
			);
	//注册
	@Path("/customer")
	@POST
	@Produces({"application/xml","application/json"})
   public void regist(Customer customer);
	//查询邮箱是否绑定
	@Path("/customer/telephone/{telephone}")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer findTelephone(@PathParam("telephone") String telephone);
		
    //绑定邮箱
	@Path("customer/updatetype/{telephone}")
	@PUT
	 public void updatetype(@PathParam("telephone") String telephone);
	//账号登陆
	@Path("/customer/login")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer findTelephoneAndpassword(@QueryParam("telephone") String telephone,
			                                 @QueryParam("password") String password);
	//根据地址查询
	@Path("/customer/findFixedAreaIdByAddress")
	@GET
	public String findFixedAreaIdByAddress(@QueryParam("address") String address);
   
}
